package com.example.document

import com.example.lib_base.Res
import com.example.lib_http.Const
import kotlinx.coroutines.flow.Flow
import okhttp3.MultipartBody
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ApiService {
    @GET(Const.URL_GET_DOCUMENT)
    fun getDoc(): Flow<Res<DocumentEntity>>

    @GET(Const.URL_DELETE_DOCUMENT)
    fun deleteDoc(@Query(Const.PARAM_ID) id: Int): Flow<Res<Any>>

    @Multipart
    @POST(Const.URL_UPLOAD_DOCUMENT)
    fun uploadDoc(@Part data: List<MultipartBody.Part>): Flow<Res<Any>>
}